1. Field of the Invention
The present invention relates to a swapping apparatus and method, and more particularly, to an apparatus and method for swapping program code and data between a main memory and an auxiliary memory, and a web video phone adopting the apparatus.
2. Description of the Related Art
Swapping includes the exchange of contents stored in a main memory with contents stored in an auxiliary memory. Here, swapping includes swap-in and swap-out. Swap-in is the transfer of a program having high priority from the auxiliary memory to the main memory. Swap-out is the transfer of a program having low priority from the main memory to the auxiliary memory.
FIG. 1 is a block diagram of a conventional web video phone which does not adopt a swapping apparatus.
Referring to FIG. 1, a DRAM 10, being a type of main memory, has a basic program code region 102 for storing a real time OS (operating system) code and a main menu, and a program code and data region 104 for swapping application programs in a flash memory 12.
The flash memory 12, being a type of auxiliary memory, stores application programs (122, 124, 126, . . . and 128) static-linked to an OS library. In the web video phone of FIG. 1, all application programs stored in the flash memory 12 are downloaded into the DRAM 10 all at once in the power starting sequence.
However, the web video phone of FIG. 1 has the following problems.
First, since the application programs static-linked to the OS library cannot be separated, they are downloaded into the DRAM 10 all at once, which requires a DRAM having a large capacity. That is, the DRAM 10 must have a capacity of at least 4M byte to download four application programs, each of 1M byte size from the flash memory 12 to the DRAM 10. Second, in the static linking of application programs stored in the flash memory, even when only one application program is changed, the other application programs must be recompiled and linked, which results in difficult management of the application programs.